<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: CAESCipherStream Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">CAESCipherStream Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="CAESCipherStream" --><!-- doxytag: inherits="CCipherStream" -->
<p><code>#include &lt;<a class="el" href="aes__cipher__stream_8h_source.html">aes_cipher_stream.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for CAESCipherStream:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classCAESCipherStream.png" usemap="#CAESCipherStream_map" alt=""/>
  <map id="CAESCipherStream_map" name="CAESCipherStream_map">
<area href="classCCipherStream.html" alt="CCipherStream" shape="rect" coords="0,0,123,24"/>
</map>
 </div></div>

<p><a href="classCAESCipherStream-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#a08a7a043543f55dc40b91557a322ae0e">CAESCipherStream</a> (std::string *pPassword)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#a5464e97aa47cc689601f249d1ccf04c4">~CAESCipherStream</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#a57928fa0882245c95f17941d681d5b06">getNext</a> (std::string *pStream, unsigned int pCount)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#a45191721c1acb7198d4abf9441a56878">getStaticKey</a> (std::string *, unsigned int pCount, unsigned int pOffset)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#a9a10464c2dbf9d8e1357783897c5fde9">reset</a> (std::string *pPassword)</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#a3fd0e021bc1f22aa93f80ad8f6de14c0">hexEncode</a> (byte *pData, int pSize)</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">OFB_Mode&lt; AES &gt;::Encryption *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#a139295e21b6291df5c87491f24455688">mAES</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCAESCipherStream.html#ac17b14ae7ff82b6771867d5b4818c201">mStaticCipherStream</a></td></tr>
</table>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a08a7a043543f55dc40b91557a322ae0e"></a><!-- doxytag: member="CAESCipherStream::CAESCipherStream" ref="a08a7a043543f55dc40b91557a322ae0e" args="(std::string *pPassword)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CAESCipherStream::CAESCipherStream </td>
          <td>(</td>
          <td class="paramtype">std::string *&#160;</td>
          <td class="paramname"><em>pPassword</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructor of <a class="el" href="classCAESCipherStream.html">CAESCipherStream</a> class. Takes the password as a parameter and initializes the AES cipher stream. The AES cipher stream is initialized in OFB mode.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pPassword</td><td>The password that serves as the key and the initialization vector of the AES cipher stream (in other words: the same password gives the same cipher stream). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5464e97aa47cc689601f249d1ccf04c4"></a><!-- doxytag: member="CAESCipherStream::~CAESCipherStream" ref="a5464e97aa47cc689601f249d1ccf04c4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CAESCipherStream::~CAESCipherStream </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a57928fa0882245c95f17941d681d5b06"></a><!-- doxytag: member="CAESCipherStream::getNext" ref="a57928fa0882245c95f17941d681d5b06" args="(std::string *pStream, unsigned int pCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CAESCipherStream::getNext </td>
          <td>(</td>
          <td class="paramtype">std::string *&#160;</td>
          <td class="paramname"><em>pStream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the next pCount bytes of the AES cipher stream and writes them onto the pStream string. It automatically takes a char array with a length of pCount and fills it with zero bytes. This char array is taken as the plain text so that we get a pure cipher stream which only depends on the password (which is also taken as the IV).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pStream</td><td>The std::string where the cipher stream bytes are written on (don't forget to specify the correct length with pCount) </td></tr>
    <tr><td class="paramname">pCount</td><td>The length of the pStream string and therefore the amount of bytes of the cipher stream that should be returned </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classCCipherStream.html#afec8a27d2cae44059773f4acd4435c21">CCipherStream</a>.</p>

</div>
</div>
<a class="anchor" id="a45191721c1acb7198d4abf9441a56878"></a><!-- doxytag: member="CAESCipherStream::getStaticKey" ref="a45191721c1acb7198d4abf9441a56878" args="(std::string *, unsigned int pCount, unsigned int pOffset)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CAESCipherStream::getStaticKey </td>
          <td>(</td>
          <td class="paramtype">std::string *&#160;</td>
          <td class="paramname"><em>pStream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pCount</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pOffset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns a fixed part of the cipher stream without taking into account the current position in the stream. With this method, any part of the stream can be read as often as desired.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pStream</td><td>The std::string where the cipher stream bytes are written on </td></tr>
    <tr><td class="paramname">pCount</td><td>The length of the pStream string and therefore the amount of bytes of the cipher stream that should be returned </td></tr>
    <tr><td class="paramname">pOffset</td><td>The offset inside the AES cipher stream </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classCCipherStream.html#a1013262cd5a93200e83e4c3a1c74247b">CCipherStream</a>.</p>

</div>
</div>
<a class="anchor" id="a3fd0e021bc1f22aa93f80ad8f6de14c0"></a><!-- doxytag: member="CAESCipherStream::hexEncode" ref="a3fd0e021bc1f22aa93f80ad8f6de14c0" args="(byte *pData, int pSize)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string CAESCipherStream::hexEncode </td>
          <td>(</td>
          <td class="paramtype">byte *&#160;</td>
          <td class="paramname"><em>pData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Encodes a given byte stream in hex. This method may be used for debugging purposes, such as logging or displaying the password hash in the command line.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pData</td><td>The data to be hex-encoded </td></tr>
    <tr><td class="paramname">pSize</td><td>The size of the data array </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9a10464c2dbf9d8e1357783897c5fde9"></a><!-- doxytag: member="CAESCipherStream::reset" ref="a9a10464c2dbf9d8e1357783897c5fde9" args="(std::string *pPassword)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CAESCipherStream::reset </td>
          <td>(</td>
          <td class="paramtype">std::string *&#160;</td>
          <td class="paramname"><em>pPassword</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Resets the AES cipher stream with the given password. It basically does the same as creating a new object of this class. The password is taken as the key and the initialization vector of the AES cipher stream (which is initialized in OFB mode).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pPassword</td><td>The password that serves as the key and the initialization vector of the AES cipher stream (in other words: the same password gives the same cipher stream). </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classCCipherStream.html#a17a5f9b872a266ca79308d31118ab6ff">CCipherStream</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a139295e21b6291df5c87491f24455688"></a><!-- doxytag: member="CAESCipherStream::mAES" ref="a139295e21b6291df5c87491f24455688" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OFB_Mode&lt;AES&gt;::Encryption* <a class="el" href="classCAESCipherStream.html#a139295e21b6291df5c87491f24455688">CAESCipherStream::mAES</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ac17b14ae7ff82b6771867d5b4818c201"></a><!-- doxytag: member="CAESCipherStream::mStaticCipherStream" ref="ac17b14ae7ff82b6771867d5b4818c201" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string <a class="el" href="classCAESCipherStream.html#ac17b14ae7ff82b6771867d5b4818c201">CAESCipherStream::mStaticCipherStream</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="aes__cipher__stream_8h_source.html">aes_cipher_stream.h</a></li>
<li><a class="el" href="aes__cipher__stream_8cxx.html">aes_cipher_stream.cxx</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:40 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
